<template>
	<view class="manage-message-detail">
		<titleName :name="name" :backShow="true"></titleName>
		<!-- 	<view class="content">
			<view class="wrap">
				<view class="title">
					<view class="name">{{msgData.title}}</view>
					<view class="time">{{msgData.publishdate}}</view>
				</view>
				<view class="line"></view>
				<view class="msg">
					{{msgData.content}}
				</view>
			</view>
		</view> -->
		<view class="wrap"  >
			<view class="title">
				<view class="name">公司名称：{{msgData.enterprisename}}</view>
				<view class="time1">第{{msgData.data1}}次提醒</view>
				<view class="publisher">
					<image :src="resourceUrl+'login-huanbao-bgc.png'" mode=""></image>
					<view class="content">
						<view class="name">{{msgData?.publisher}}</view>
						<view class="publish-time">
							<view class="publish">发布</view>
							<view class="time">{{msgData?.committime}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="msg-wrap">
				<view class="type">{{msgData.title}}</view>
				<!-- <view class="msg" v-if="msgData.noticetype==3">{{msgData.content}}</view>
				<view class="msg" v-if="msgData.noticetype==1 || msgData.noticetype==2">污染源类别：{{msgData.data1}}</view>
				<view class="msg" v-if="msgData.noticetype==1 || msgData.noticetype==2">污染物名称：{{msgData.data2}}</view>
				<view class="msg" v-if="msgData.noticetype==5">报告类型：{{msgData.data1}}</view>
				<view class="msg" v-if="msgData.noticetype==5">主要内容：{{msgData.data2}}</view>
				<view class="msg" v-if="msgData.noticetype==4">整改内容：{{msgData.content}}</view> -->
				<view class="msg">{{disposeContent(msgData.content).clearEnd}}</view>
				
				
				<button class="detail" v-if="msgData.noticetype==3" @click="jumpGuide(msgData.attachurl)">
					(参考办理指南)
				</button>
				<button class="detail" v-if="msgData.noticetype==2"
					@click="jumpOnlineMonitorContent(msgData.subnoticetype)">
					(参照以下要求)
				</button>
				
				<!--yecw add start 20250506-->
				<view class="table-wrap" style="" v-if="msgData.noticetype==1">
						<view class="title-wrap">
							<view class="type" style="color:#070707;width:25%;font-size:24rpx;">污染源名称</view>
							<view class="type" style="color:#070707;width:27%;font-size:24rpx;">手工监测采样方法及个数</view>
							<view class="type" style="color:#070707;width:18%;font-size:24rpx;">手工监测频次</view>
							<view class="type" style="color:#070707;width:30%;font-size:24rpx;">手工测定方法</view>
						</view>
						<view class="item" v-for="item in msgData.lstEnterpriseMonitorInfo" :key="item.id">
							<view class="type" style="color:#070707;width:25%;font-size:24rpx;height: auto;">{{item.wastename}}</view>
							<view class="type" style="color:#070707;width:27%;font-size:24rpx;height: auto;">{{item.manualcollectmethod}}</view>
							<view class="type" style="color:#070707;width:18%;font-size:24rpx;height: auto;">{{item.monitortimes}}</view>
							<view class="type" style="color:#070707;width:30%;font-size:24rpx;height: auto;">{{item.manualtestmethod}}</view>
						</view>
				</view>
				<!--yecw add end 20250506-->

			</view>
			<view class="btn-wrap">
				<button v-if="msgData.noticetype==4">
					{{msgData.followflag==1?'已执行':msgData.followflag==2?'审核中':'未执行'}}
				</button>
			</view>

			
		</view>





	</view>
</template>

<script setup>
	import disposeContent from '../../utils/disposeContent'
	import titleName from '../../components/titleName.vue'
	import noData from '../../components/noDataShow.vue'
	import {
		resourceUrl
	} from '../../request/config'
	import http from '../../request/index.js'
	import {
		ref
	} from 'vue'
	import {
		onLoad
	} from "@dcloudio/uni-app"
	let name = "消息"
	let seltop = ref(1)
	let msgData = ref({})
	let title = ref('')
	let id = ref('')
	let usertype = ref('')
	let jumpGuide = () => {

		uni.navigateTo({
			url: `/messagePageOther/licensingguidelines/index`
		})
	}
	let jumpOnlineMonitorContent = (subnoticetype) => {
		let type;

		if (subnoticetype == 21) {
			type = 2
		} else if (subnoticetype == 22) {
			type = 1
		} else {
			type = 3
		}
		uni.navigateTo({
			url: `/messagePageOther/onlinemonitorcontent/index?type=${type}`
		})
	}
	onLoad((e) => {
		usertype.value = uni.getStorageSync('usertype')
		let id = e.id

		http({
			url: '/greenAdmRecvMessage/detail',
			data: {
				id
			}
		}).then((res) => {
			if (res.code == 0) {
				msgData.value = res.data
			}

		})


	})
</script>

<style lang="scss" scoped>
	
	.manage-message-detail {
		width: 100vw;
		height: 100vh;
		//overflow: hidden;
		overflow: scroll;
		

		.wrap {
			width: 750rpx;
			height: calc(100vh - 160upx);
			background: #F3F5F7;
			padding-top: 22upx;

			.title {
				height: 276upx;
				width: 100vw;
				color: #34363A;
				background-color: #fff;
				padding: 33upx 0 27upx 54upx;
				display: flex;
				flex-direction: column;
				// justify-content: space-between;

				.publisher {
					display: flex;
					align-items: center;


					image {
						width: 55upx;
						height: 55upx;
						margin-right: 10upx;
					}

					.content {
						.name {

							font-family: Source Han Sans CN;
							font-weight: 500;
							font-size: 24rpx;
							color: #070707;

						}

						.publish-time {
							display: flex;
							align-items: center;

							.publish {
								width: 48rpx;
								height: 23rpx;
								background: #EEF2FF;
								border-radius: 6rpx;
								line-height: 23upx;
								text-align: center;
								font-family: Source Han Sans CN;
								font-weight: 500;
								font-size: 14rpx;
								color: #0874FA;
								margin-right: 7upx;

							}

							.time {

								font-family: Source Han Sans CN;
								font-weight: 400;
								font-size: 22rpx;
								color: #999999;

							}
						}
					}
				}

			}

			.name {

				font-family: Microsoft YaHei;
				font-weight: 400;
				font-size: 35rpx;
				color: #34363A;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}

			.time1 {

				font-family: Microsoft YaHei;
				font-weight: 400;
				font-size: 31rpx;
				color: #96989F;
				margin-top: 22upx;
				margin-bottom: 32upx;


			}

			.btn-wrap {
				display: flex;
				justify-content: center;
				margin-top: 176upx;

				button {
					width: 672rpx;
					height: 88rpx;
					background: rgba(8, 116, 250, .62);
					border-radius: 44rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					font-size: 34rpx;
					color: #FFFFFF;
					text-align: center;
					line-height: 88upx;
				}
			}

			.msg-wrap {
				margin-top: 15upx;
				background-color: #fff;
				padding: 30upx 50upx 68upx 52upx;

				.type {

					font-family: Microsoft YaHei;
					font-weight: 400;
					font-size: 31rpx;
					color: #0874FA;

				}

				.msg:nth-child(2) {

					margin-top: 40upx !important;
				}

				.msg {


					font-family: Microsoft YaHei;
					font-weight: 400;
					font-size: 31rpx;
					color: #333333;
					line-height: 55rpx;
					white-space: pre-line;
				}

				.detail {

					font-family: Microsoft YaHei;
					font-weight: 400;
					font-size: 31rpx;
					color: #0874FA;
					line-height: 75rpx;
					text-align: left;

				}


			}




		}






	}

	.table-wrap {
		border: 2upx solid #DADADA;
		margin-top: 23upx;
	
		.item {
	
			background-color: #fff !important;
			border-top: 2upx solid #DADADA;
			display: flex;
	
	
			.type {
				font-family: Microsoft YaHei;
				font-weight: 400;
				padding: 28upx 10upx !important;
				color: #333333;
				display: flex;
				align-items: center;
				height: auto;
				line-height: normal;
				text-align: center;
				justify-content: center;
				font-size: 21upx !important;
			}
	
			.type:nth-of-type(1),
			.type:nth-of-type(2),
			.type:nth-of-type(3) {
				border-right: 2upx solid #DADADA
			}
	
			.type:nth-of-type(4) {
				width: 207upx;flex-shrink: 0;
			}
	
			.type:nth-of-type(3) {
				width: 106upx;
				flex-shrink: 0;
				border-right: 2upx solid #DADADA
			}
		}
	
		.title-wrap {
			display: flex;
	
			flex-wrap: nowrap;
			width: 100%;
			height: 103upx;
			background: #F6F8F9;
	
			.type {
	
				font-family: Microsoft YaHei;
				font-weight: 400;
				font-size: 24rpx;
				color: #333333;
				display: flex;
				align-items: center;
				height: 103upx;
				line-height: normal;
				text-align: center;
				justify-content: center;
				padding: 28upx 10upx !important;
			}
	
			.type:nth-of-type(1),
			.type:nth-of-type(2),
			.type:nth-of-type(3) {
				border-right: 2upx solid #DADADA
			}
	
			.type:nth-of-type(3) {
				width: 106upx;
				flex-shrink: 0;
				border-right: 2upx solid #DADADA
			}
			.type:nth-of-type(4) {
				width: 207upx;flex-shrink: 0;
			}
		}
	}
	

</style>